﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="VH.SharePoint.Api.Scripts.UI" Location="ScriptLink" Rights="AddListItems" Sequence="100" ScriptBlock="                
  ExecuteOrDelayUntilScriptLoaded(function() { 
  var scriptName = 'VH.SharePoint.Api.UI.js';
  var scriptUrl = _spPageContextInfo.webServerRelativeUrl.replace(/\/$/, '')+'/_layouts/api/'+scriptName;
      SP.SOD.registerSod(scriptName, scriptUrl);
      SP.SOD.executeFunc(scriptName, null, null);
  }, 'SP.js');
  " />
  <CustomAction
      Id="VH.SharePoint.Api.Actions.NewPost"
      Location="CommandUI.Ribbon"
      RegistrationType="List"
      RegistrationId="850"
      Sequence="0"
      Rights="AddListItems"
      Title="New Blog Post from Pages Library">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
         Location="Ribbon.Documents.New.Controls._children">
          <Button Id="VH.SharePoint.Api.Controls.NewPost"
           Command="VH.SharePoint.Api.Command.NewPost"
           Image32by32="/_layouts/images/api/newpost.png"
           LabelText="$Resources:VH.SharePoint.Api.Blog,Title_NewPost_Command"
           ToolTipTitle="$Resources:VH.SharePoint.Api.Blog,Title_NewPost_Command_Tooltip"
           ToolTipDescription="$Resources:VH.SharePoint.Api.Blog,Description_NewPost_Command_Tooltip"
           TemplateAlias="o2"
           Sequence="2" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
  <CustomAction
      Id="VH.SharePoint.Api.Actions.NewPost"
      Location="CommandUI.Ribbon"
      RegistrationType="List"
      RegistrationId="119"
      Sequence="0"
      Rights="AddListItems"
      Title="New Blog Post from Pages Library">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
         Location="Ribbon.Documents.New.Controls._children">
          <Button Id="VH.SharePoint.Api.Controls.NewPost"
           Command="VH.SharePoint.Api.Command.NewPost"
           Image32by32="/_layouts/images/api/newpost.png"
           LabelText="$Resources:VH.SharePoint.Api.Blog,Title_NewPost_Command"
           ToolTipTitle="$Resources:VH.SharePoint.Api.Blog,Title_NewPost_Command_Tooltip"
           ToolTipDescription="$Resources:VH.SharePoint.Api.Blog,Description_NewPost_Command_Tooltip"
           TemplateAlias="o2"
           Sequence="2" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
</Elements>
